<?xml version='1.0' encoding='utf-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<ui:composition template="/commun_page/template.xhtml"
	xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:a4j="http://richfaces.org/a4j"
	>

	<ui:define name="title">
			Ajout d'un Bateau
	</ui:define>

	<ui:define name="body">

     	<h:form id="ajoutBateauForm">
     		<table >
				<tr>
					<td><h:outputText value="N° Immatriculation :" /></td>
					<td><h:inputText id="noImmat" value="#{manager.bateau.no_matriculation}" required="true">
						<f:validateLength minimum="6" /></h:inputText></td>
					<td><h:message for="noImmat"  errorClass="erreur" /></td>
				</tr>
				<tr>
					<td><h:outputText value="Nom :" /></td>
					<td><h:inputText id="nomBateau" value="#{manager.bateau.nom}"  required="true" >
						<f:validateLength minimum="2" /></h:inputText></td>
					<td><h:message for="nomBateau"  errorClass="erreur" /></td>
				</tr>
				<tr>
					<td><h:outputText value="Taille :" /></td>
					<td><h:inputText id="tailleBateau" value="#{manager.bateau.taille}"  required="true" >
						<f:validateLength minimum="2" /></h:inputText></td>
					<td><h:message for="tailleBateau"  errorClass="erreur" /></td>
				</tr>
				<tr>
					<td><h:outputText value="Latitude :" /></td>
					<td><h:inputText id="latBateau" value="#{manager.bateau.latitude}"  required="true" >
						<f:validateLength minimum="2" /></h:inputText></td>
					<td><h:message for="latBateau"  errorClass="erreur" /></td>
				</tr>
				<tr>
					<td><h:outputText value="Longitude :" /></td>
					<td><h:inputText id="longBateau" value="#{manager.bateau.longitude}"  required="true" >
						<f:validateLength minimum="2" /></h:inputText></td>
					<td><h:message for="longBateau"  errorClass="erreur" /></td>
				</tr>
				<tr>
					<td><h:outputText value="Photo :" /></td>
					<td><h:inputText id="photoBateau" value="#{manager.bateau.photo}"  required="true" >
						<f:validateLength minimum="2" /></h:inputText></td>
					<td><h:message for="photoBateau"  errorClass="erreur" /></td>
				</tr>
                <a4j:mediaOutput element="img" mimeType="#{file.mime}"
	                createContent="#{fileUploadBean.paint}" value="#{row}"
	                style="width:100px; height:100px;" cacheable="false">
	                <f:param value="#{fileUploadBean.timeStamp}" name="time"/>  
                </a4j:mediaOutput>
				<tr>
					<td>&nbsp;</td>
					<td><h:commandButton value="Enregistrer" action="#{manager.ajouterBateau}" /></td>
					<td>&nbsp;</td>
				</tr>
			</table>			
			
		</h:form>
		
		<br />
		<br />
		
		</ui:define>
</ui:composition>

